package com.lzw.service.impl.dormitoryAdmin;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.lzw.mapper.dormitoryAdmin.FeedbackMapper;
import com.lzw.pojo.Feedback;
import com.lzw.service.dormitoryAdmin.FeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.List;

@Service
public class FeedbackServiceImpl implements FeedbackService {

    @Autowired
    private FeedbackMapper feedbackMapper;

    @Override
    public List<Feedback> list(Integer pageNum, Integer pageSize, LocalDate feedbackDate, Integer studentId) {
        PageHelper.startPage(pageNum,pageSize);
        List<Feedback> list = feedbackMapper.list(feedbackDate,studentId);
        Page<Feedback> feedbacks = (Page<Feedback>) list;
        return feedbacks;
    }


    @Override
    public void delete(List<Integer> ids) {
        feedbackMapper.delete(ids);
    }

    @Override
    public void update(Feedback feedback) {
        feedbackMapper.update(feedback);
    }
}
